<template>
  <div>

    <h3>form表单配置</h3>
    <el-test :options="options" class="mab-1"></el-test>
    <h3>配置参数</h3>
    <el-input type="textarea" v-model="optionStr" :autosize="autosize">
    </el-input>
    <!--<app-list :item-map="listMap" :current="current"></app-list>-->
  </div>
</template>

<script>
  import elTest from './test'
  import config from '../model/setting'
  import AppList from './dlg-list.vue'
  import models from '../model/list'
  import * as utils from '../utils/index'
  //  import ElInput from './input'
  export default {
    data () {
      return {
        options: config.config.items,
        listMap: models.items,
        current: 1,
        autosize: {minRows: 5, maxRows: 18}
//        optionStr:this.format(this.options)
      }
    },
    computed: {
      optionStr () {
        return this.format(this.options)
      }
    },
    methods: {
      format(data){
        console.log(this.options)
        return utils.formatJson(JSON.stringify(data))
      }
    },
    components: {
      elTest, AppList
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
  h1, h2 {
    font-weight: normal;
  }

  ul {
    list-style-type: none;
    padding: 0;
  }

  li {
    display: inline-block;
    margin: 0 10px;
  }

  a {
    color: #42b983;
  }

  .mab-1 {
    margin-bottom: 15px;
  }
</style>
